home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / pine / osdep / lstcmpnt.dos < prev    next >
Text File  |  1996-04-26  |  540b  |  26 lines

  1. /*----------------------------------------------------------------------
  2.       Return pointer to last component of pathname.
  3.  
  4.   Args: filename     -- The pathname.
  5.  
  6.  Result: Returned pointer points to last component in the input argument.
  7.   ----*/
  8. char *
  9. last_cmpnt(filename)
  10.     char *filename;
  11. {
  12.     register char *p = NULL, *q = filename;
  13.  
  14.     while(q = strchr(q, '\\'))
  15.       if(*++q)
  16.     p = q;
  17.  
  18.     if(!p && isalpha((unsigned char)*filename)
  19.     && *(filename+1) == ':' && *(filename+2))
  20.       p = filename + 2;
  21.        
  22.     return(p);
  23. }
  24.  
  25.  
  26.